package cn.com.blueInfo.bpm.person.entity;

import cn.com.blueInfo.bpm.common.entity.BaseEntity;
import cn.com.blueInfo.bpm.person.enums.GroupFormulaFilterType;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 群组公式表
 * @author suxch
 * @since 2025-08-24 01:39:52
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "mc_osm_group_formula", autoResultMap = true)
@Schema(description = "群组公式表")
public class GroupFormula extends BaseEntity {

    /** ID */
    @TableId(type = IdType.INPUT)
    @Schema(description = "ID")
    private Long id;
    /** 群组ID */
    @Schema(description = "群组ID")
    private Long groupId;
    /** 过滤方式：0-动态过滤，1-岗位定义 */
    @Schema(description = "过滤方式：0-动态过滤，1-岗位定义")
    private GroupFormulaFilterType filterType;
    /** 过滤范围 */
    @Schema(description = "过滤范围")
    private String filterBound;
    /** 过滤SQL */
    @Schema(description = "过滤SQL")
    @TableField(typeHandler = FastjsonTypeHandler.class)
    private JSONObject filterSql;
    /** 拟稿人所在组织ID */
    @Schema(description = "拟稿人所在组织ID")
    private Long draftOrgId;

}
